<?php

namespace app\admin\controller;

class Login
{
    /**
     * 登录页面
     */
    public function index(){
        $data = array();
        $data["versionData"] = app("L_Common_version")->currentInfo();
        $data["request"] = request()->param();
        return view("admin/login/index", $data);
    }

    /**
     * 登录
     */
    public function login()
    {
        $result = app("P_BackendAccount")->login();
        return jsonResponse($result);
    }

    /**
     * 登出接口
     */
    public function logout()
    {
        app("P_BackendAccount")->logout();
        return  redirect(YIFANG_ROUTE_PREFIX."/login");
    }
}